package com.knight.model;


import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

@Document(collection = "log")
@Getter
@Setter
public class Log implements Serializable {


    private static final long serialVersionUID = 1L;

    /**
     * 日志主键
     */
    private String logId;

    /**
     * 日志类型(info:正常,error:错误)
     */
    private String type;

    /**
     * 日志标题
     */
    private String title;

    /**
     * 请求地址/IP
     */
    private String remoteAddr;

    /**
     * URI
     */
    private String uri;

    /**
     * 请求的方法类型(post/get)
     */
    private String method;

    /**
     * 提交参数
     */
    private String params;

    /**
     * 异常
     */
    private String exception;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 耗时（ms）
     */
    private Long executeTime;


    /**
     * 返回参数
     */
    private String resultParams;





    @Override
    public String toString() {
        return "SysLogEntity{" +
                "logId=" + logId +
                ", type='" + type + '\'' +
                ", title='" + title + '\'' +
                ", remoteAddr='" + remoteAddr + '\'' +
                ", uri='" + uri + '\'' +
                ", method='" + method + '\'' +
                ", params='" + params + '\'' +
                ", exception='" + exception + '\'' +
                ", startTime=" + startTime +
                ", executeTime=" + executeTime +
                ", resultParams='" + resultParams + '\'' +
                '}';
    }
}